using UnityEngine;
using System.Collections;


public class PapaBear : Character {
	public string m_strName = "Papa Bear";
	
	//Base stats
	#region Basic stats declaration
	private int m_nStrength = 55;
	private int m_nAgi = 23;
	private int m_nInt = 10;
	private int m_nLck = 1;
	private int m_nLevel = 1;
	private int m_nAP = 100;
	#endregion
	//Stat increase
	#region Char specific stat increase per lvl
	private int m_nStrInc = 6;
	private int m_nAgiInc = 3;
	private int m_nIntInc = 1;
	private int m_nLckInc = 0;
	#endregion
	#region Base stat growth per lvl
	private int m_nStrGrowth = 10;
	private int m_nAgiGrowth = 3;
	private int m_nIntGrowth = 2;
	private int m_nLckGrowth = 0;
	#endregion
	//Battle stats
	#region BattleStats stats
	private int m_nDmgReduction;
//	private int m_nHealth;
	private int m_nAPRegen;
	private int m_nIncDOT;
	private int m_nIncDMG;
	#endregion
	//Skills
	#region Skills
	public enum Skills{
		HEAVY_MAUL,
		VICOUS_STRIKE,
		PUMMEL,
		BEAR_HUG
	};
	public Skills enumSkill1;
	public Skills enumSkill2;
	public Skills enumSkill3;
	public Skills enumSkill4;
	
	public ArrayList aSkills = new ArrayList();
	
	#endregion
	//Lvl up
	#region Function LvlUp
	public void LvlUp()
	{
		m_nLevel += 1;	
		//assign stats based on lvl
		m_nStrength = m_nStrength + (m_nLevel - 1) * m_nStrInc + (m_nLevel - 1) * m_nStrGrowth;
		m_nAgi = m_nAgi + (m_nLevel - 1) * m_nAgiInc + (m_nLevel - 1) * m_nAgiGrowth;
		m_nInt = m_nInt + (m_nLevel - 1) * m_nIntInc + (m_nLevel - 1) * m_nIntGrowth;
		m_nLck = m_nLck + (m_nLevel - 1) * m_nLckInc + (m_nLevel - 1) * m_nLckGrowth;
		
//		print (m_nStrength);
//		print (m_nAgi);
//		print (m_nInt);
//		print (m_nLck);
	}
	#endregion
		
	#region Override abstract Character functions
	public override int GetAgi(){
		return m_nAgi;
	}
	public override void RegenAP(){
		m_nAP = m_nAP + m_nAPRegen;
	}
	public override void TakeDMG(int p_nDMG){
		//Dmg reduction
		m_nHealth -= p_nDMG;
	}
	public override string GetName ()
	{
		return(m_strName);
	}
	protected override void DealDMG(int p_nDMG){
		
	}
	protected override void DealDOT(int p_nDOT){
		
	}
	protected override void Heal(int p_nHeal){
		
	}
	protected override void HOT(int p_nHOT){
		
	}
	#endregion
	
	#region Character skills
	public void HEAVY_MAUL(){
		Debug.Log("HEAVY_MAUL");
		//Deals 100 + (20 per level) + (50% of STR) of damage to the enemy.
		//After end of attack animation deal damage
		
	}
	public void VICOUS_STRIKE(){
		Debug.Log("VICOUS_STRIKE");
		//Deals 50 + (10 per level) + (50% of STR) of damage. Additionally, 
		//the attack poisons the enemy, causing 10 + (10 per level) + (10% of STR) 
		//of damage for 4 turns.
		
	}
	public void PUMMEL(){
		Debug.Log("PUMMEL");
		//Deals 200 + (40 per level) + (70% of STR) of damage to the enemy.
		//If enemy is hit, gain 10 AP.
	}
	public void BEAR_HUG(){
		Debug.Log("BEAR_HUG");
		
	}
	#endregion
	
	void Awake () {
		#region assign skills to delegates
		aSkills.Add(enumSkill1);
		aSkills.Add(enumSkill2);
		aSkills.Add(enumSkill3);
		aSkills.Add(enumSkill4);
		
		for (int x = 0; x < aSkills.Count; x++){
			
			switch (aSkills[x].ToString()){
				case "HEAVY_MAUL":
					switch(x){
						case 0:
							dSkill1 += HEAVY_MAUL;
						break;
						case 1:
							dSkill2 += HEAVY_MAUL;
						break;
						case 2:
							dSkill3 += HEAVY_MAUL;
						break;
						case 3:
					 		dSkill4 += HEAVY_MAUL;
						break;
					}
				break;
				case "VICOUS_STRIKE":
					switch(x){
						case 0:
							dSkill1 += VICOUS_STRIKE;
						break;
						case 1:
							dSkill2 += VICOUS_STRIKE;
						break;
						case 2:
							dSkill3 += VICOUS_STRIKE;
						break;
						case 3:
					 		dSkill4 += VICOUS_STRIKE;
						break;
					}
				break;
				case "PUMMEL":
					switch(x){
						case 0:
							dSkill1 += PUMMEL;
						break;
						case 1:
							dSkill2 += PUMMEL;
						break;
						case 2:
							dSkill3 += PUMMEL;
						break;
						case 3:
					 		dSkill4 += PUMMEL;
						break;
					}
				break;
				case "BEAR_HUG":
					switch(x){
						case 0:
							dSkill1 += BEAR_HUG;
						break;
						case 1:
							dSkill2 += BEAR_HUG;
						break;
						case 2:
							dSkill3 += BEAR_HUG;
						break;
						case 3:
					 		dSkill4 += BEAR_HUG;
						break;
					}
				break;
					
			}
		}
//		dSkill1 += enumSkill1;
//		dSkill2 += enumSkill2;
//		dSkill3 += enumSkill3;
//		dSkill4 += enumSkill4;
		
		#endregion
//		Debug.Log("Skills");
//		for (int x=0; x < aSkills.Count; x++){
//			Debug.Log(aSkills[x].ToString());	
//		}
	}
	// Use this for initialization
	void Start () 
	{   
//		dSkill1();
//		dSkill2();
//		dSkill3();
//		dSkill4();

		#region Get Papa Bear lvl
		//get lvl here
		
		//assign stats based on lvl
		m_nStrength = m_nStrength + (m_nLevel - 1) * m_nStrInc + (m_nLevel - 1) * m_nStrGrowth;
		m_nAgi = m_nAgi + (m_nLevel - 1) * m_nAgiInc + (m_nLevel - 1) * m_nAgiGrowth;
		m_nInt = m_nInt + (m_nLevel - 1) * m_nIntInc + (m_nLevel - 1) * m_nIntGrowth;
		m_nLck = m_nLck + (m_nLevel - 1) * m_nLckInc + (m_nLevel - 1) * m_nLckGrowth;
//		print (m_nStrength);
//		print (m_nAgi);
//		print (m_nInt);
//		print (m_nLck);
		
		#endregion
		#region Initialize computed stats
		
		m_nHealth = 300 + (m_nStrength * m_nHealthModifier);
		m_nAPRegen = 10 + (m_nInt / m_nAPRegenModifier);
//		print ("Health " + m_nHealth);
//		print ("AP Regen per turn " + m_nAPRegen);
		
		#endregion
	}
	// Update is called once per frame
	void Update () {
//		print (m_strName + " " + bTurn);
		print (m_strName + " hp " + m_nHealth);
//		if (bTurn == true){
//			print(m_strName + "'s turn"); 
//			BattleManager.Instance.DealDMG(200,m_strName);
//			BattleManager.Instance.EndTurn();
			
//		}
	}
}
